package edu.sctu.practice.class01.zhoumengxue.assign.assign08.assign08_03;

import java.awt.*;

/**
 * Created by ASUS on 2015/12/24.
 */
public class ImageCanvas extends Canvas{
    Image image = null;

    public ImageCanvas() {

        setSize(200, 200);
    }

    public void paint(Graphics g) {
        if (image != null)
            g.drawImage(image, 0, 0, this);
    }

    public void setImage(Image image) {
        this.image = image;
    }
}
